package com.chushouya.controller.manager.api;

import com.chushouya.common.constant.ServiceType;
import com.general.framework.core.schema.Response;
import com.chushouya.manager.dto.admin.bonus.ReceiveBonusDTO;
import com.chushouya.manager.service.api.ReceiveBonusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping(ServiceType.API + "/receiveBonus")
@Api(tags = ServiceType.API + "发放红包接口")
public class ReceiveBonusApiController {

    @Resource
    private ReceiveBonusService receiveBonusService;

    @PostMapping("/userReceiveBonus")
    @ApiOperation("用户领取红包")
    public Response<String> userReceiveBonus(@RequestBody @Valid ReceiveBonusDTO receiveBonusDTO) {
        receiveBonusService.userReceiveBonus(receiveBonusDTO);
        return Response.success("领取成功");
    }
}
